# $Id: PKGBUILD 174822 2013-01-07 18:49:23Z andyrtr $
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=xdg-utils
_oldver=1.1.0
_gitver=050333e34e2fe7430ad2ead37e5a0420ac0c2a3e # xdg-mime does not search mimeinfo.cache
_gitdate=20121008
pkgver=${_oldver}.git${_gitdate}
pkgrel=2
pkgdesc="Command line tools that assist applications with a variety of desktop integration tasks"
arch=('any')
url="http://portland.freedesktop.org/"
license=('MIT')
depends=('sh' 'xorg-xset') # xset needed inside xdg-screensaver
makedepends=('docbook-xsl' 'lynx' 'xmlto')
optdepends=('kdebase-runtime: for KDE support in xdg-open'
            'libgnome: for GNOME support in xdg-open'
            'exo: for Xfce support in xdg-open'
            'xorg-xprop: for Xfce support in xdg-open'
            'pcmanfm: for LXDE support in xdg-open'
            'perl-file-mimeinfo: for generic support in xdg-open')
source=(#http://cgit.freedesktop.org/xdg/xdg-utils/snapshot/xdg-utils-${_gitver}.tar.gz
        ftp://ftp.archlinux.org/other/$pkgname/xdg-utils-${_gitver}.tar.gz)
md5sums=('cc321af15724cf7ee1ef014c4a0120ea')

build() {
	cd ${srcdir}/${pkgname}-${_gitver}
	./configure --prefix=/usr --mandir=/usr/share/man
	make scripts-clean -C scripts # needed if it's a git snapshot
	make man scripts -C scripts # needed if it's a git snapshot
#	make # for release builds
}

package() {
	cd ${srcdir}/${pkgname}-${_gitver}
	make DESTDIR="${pkgdir}" install
	install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	
	# install empty directory to prevent xdg-desktop-menu install *.desktop to fail, see FS#33316
	install -dm755 $pkgdir/usr/share/desktop-directories
}
